// 导入axios实例
import instance from "@/utils/http";
// 导入岗位数据类型
import type { GangWeiData } from "@/types";
import type { AxiosPromise } from "axios";
// 增
export const addGangweiAPI = (data: GangWeiData) => {
    return instance({
        method: 'POST',
        url: '/gangwei',
        data: data
    })
}

// 删
export const delGangweiAPI = (id: number) => {
    return instance({
        method: 'DELETE',
        url: '/gangwei/' + id
    })
}

// 改
export const updateGangweiAPI = (id: number, data: GangWeiData) => {
    return instance({
        method: 'PUT',
        url: '/gangwei/' + id,
        data: data
    })
}

// 查
export const getGangweiAPI = (params: any): AxiosPromise<GangWeiData[]> => {
    return instance({
        method: 'GET',
        url: '/gangwei',
        params: params
    })
}